package com.baidu.mapapi;

import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
import java.util.ArrayList;

class j
  implements h
{
  private MKSearchListener a;

  public j(MKSearchListener paramMKSearchListener)
  {
    this.a = paramMKSearchListener;
  }

  private int a(Bundle paramBundle, MKRouteAddrResult paramMKRouteAddrResult)
  {
    Parcelable[] arrayOfParcelable = paramBundle.getParcelableArray("aryAddr");
    Bundle localBundle1 = (Bundle)arrayOfParcelable[0];
    if (localBundle1 != null)
    {
      ArrayList localArrayList1 = new ArrayList();
      a(localBundle1, localArrayList1);
      paramMKRouteAddrResult.mStartPoiList = localArrayList1;
    }
    Bundle localBundle2 = (Bundle)arrayOfParcelable[1];
    if (localBundle2 != null)
    {
      ArrayList localArrayList2 = new ArrayList();
      b(localBundle2, localArrayList2);
      paramMKRouteAddrResult.mStartCityList = localArrayList2;
    }
    Bundle localBundle3 = (Bundle)arrayOfParcelable[2];
    if (localBundle3 != null)
    {
      ArrayList localArrayList3 = new ArrayList();
      a(localBundle3, localArrayList3);
      paramMKRouteAddrResult.mEndPoiList = localArrayList3;
    }
    Bundle localBundle4 = (Bundle)arrayOfParcelable[3];
    if (localBundle4 != null)
    {
      ArrayList localArrayList4 = new ArrayList();
      b(localBundle4, localArrayList4);
      paramMKRouteAddrResult.mEndCityList = localArrayList4;
    }
    return paramBundle.getInt("type");
  }

  private void a(Bundle paramBundle, MKAddrInfo paramMKAddrInfo)
  {
    paramMKAddrInfo.strAddr = paramBundle.getString("addr");
    paramMKAddrInfo.geoPt = new GeoPoint(paramBundle.getInt("y"), paramBundle.getInt("x"));
  }

  private void a(Bundle paramBundle, MKAddrInfo paramMKAddrInfo, int paramInt)
  {
    paramMKAddrInfo.strAddr = paramBundle.getString("addr");
    paramMKAddrInfo.strBusiness = paramBundle.getString("business");
    paramMKAddrInfo.addressComponents = new MKGeocoderAddressComponent();
    paramMKAddrInfo.addressComponents.streetNumber = paramBundle.getString("streetNumber");
    paramMKAddrInfo.addressComponents.street = paramBundle.getString("street");
    paramMKAddrInfo.addressComponents.district = paramBundle.getString("district");
    paramMKAddrInfo.addressComponents.city = paramBundle.getString("city");
    paramMKAddrInfo.addressComponents.province = paramBundle.getString("province");
    int i = paramBundle.getInt("x");
    paramMKAddrInfo.geoPt = new GeoPoint(paramBundle.getInt("y"), i);
    if (paramBundle.containsKey("aryCaption"))
    {
      String[] arrayOfString1 = paramBundle.getStringArray("aryCaption");
      String[] arrayOfString2 = paramBundle.getStringArray("aryAddr");
      String[] arrayOfString3 = paramBundle.getStringArray("aryTel");
      String[] arrayOfString4 = paramBundle.getStringArray("aryZip");
      int[] arrayOfInt1 = paramBundle.getIntArray("aryType");
      int[] arrayOfInt2 = paramBundle.getIntArray("aryX");
      int[] arrayOfInt3 = paramBundle.getIntArray("aryY");
      String str = paramBundle.getString("city");
      ArrayList localArrayList = new ArrayList();
      int j = arrayOfString1.length;
      for (int k = 0; k < j; k++)
      {
        MKPoiInfo localMKPoiInfo = new MKPoiInfo();
        localMKPoiInfo.name = arrayOfString1[k];
        localMKPoiInfo.address = arrayOfString2[k];
        localMKPoiInfo.city = str;
        localMKPoiInfo.phoneNum = arrayOfString3[k];
        localMKPoiInfo.postCode = arrayOfString4[k];
        localMKPoiInfo.ePoiType = arrayOfInt1[k];
        localMKPoiInfo.pt = new GeoPoint(arrayOfInt3[k], arrayOfInt2[k]);
        localArrayList.add(localMKPoiInfo);
      }
      paramMKAddrInfo.poiList = localArrayList;
    }
  }

  private void a(Bundle paramBundle, MKDrivingRouteResult paramMKDrivingRouteResult, int paramInt)
  {
    ArrayList localArrayList1;
    MKRoutePlan localMKRoutePlan;
    ArrayList localArrayList2;
    int n;
    MKRoute localMKRoute;
    Bundle localBundle1;
    ArrayList localArrayList4;
    ArrayList localArrayList5;
    int i5;
    label287: ArrayList localArrayList6;
    int i6;
    try
    {
      String str1 = paramBundle.getString("st_name");
      int i = paramBundle.getInt("st_pt_x");
      int j = paramBundle.getInt("st_pt_y");
      MKPlanNode localMKPlanNode1 = new MKPlanNode();
      localMKPlanNode1.name = str1;
      localMKPlanNode1.pt = new GeoPoint(j, i);
      paramMKDrivingRouteResult.a(localMKPlanNode1);
      String str2 = paramBundle.getString("en_name");
      int k = paramBundle.getInt("en_pt_x");
      int m = paramBundle.getInt("en_pt_y");
      MKPlanNode localMKPlanNode2 = new MKPlanNode();
      localMKPlanNode2.name = str2;
      localMKPlanNode2.pt = new GeoPoint(m, k);
      paramMKDrivingRouteResult.b(localMKPlanNode2);
      localArrayList1 = new ArrayList();
      if (paramBundle.getInt("planNum") <= 0)
        break label820;
      localMKRoutePlan = new MKRoutePlan();
      localMKRoutePlan.a(paramBundle.getInt("distance"));
      localArrayList2 = new ArrayList();
      Parcelable[] arrayOfParcelable1 = paramBundle.getParcelableArray("aryRoute");
      n = 0;
      if (n >= arrayOfParcelable1.length)
        break label805;
      localMKRoute = new MKRoute();
      localBundle1 = (Bundle)arrayOfParcelable1[n];
      localMKRoute.a(localBundle1.getInt("distance"));
      localMKRoute.b(1);
      localMKRoute.a(localMKPlanNode1.pt);
      localMKRoute.b(localMKPlanNode2.pt);
      if (!localBundle1.containsKey("link"))
        break label646;
      int i4 = localBundle1.getInt("link");
      localArrayList4 = new ArrayList();
      localArrayList5 = new ArrayList();
      i5 = 0;
      if (i5 >= i4)
        break label632;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = Integer.valueOf(i5);
      int[] arrayOfInt1 = localBundle1.getIntArray(String.format("aryX%d", arrayOfObject1));
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Integer.valueOf(i5);
      int[] arrayOfInt2 = localBundle1.getIntArray(String.format("aryY%d", arrayOfObject2));
      if (arrayOfInt1 == null)
        break label827;
      localArrayList6 = new ArrayList();
      i6 = 0;
      label372: if (i6 < arrayOfInt1.length)
      {
        if ((i6 != 0) && (arrayOfInt2[i6] == arrayOfInt2[(i6 - 1)]) && (arrayOfInt1[i6] == arrayOfInt1[(i6 - 1)]))
          break label833;
        localArrayList6.add(new GeoPoint(arrayOfInt2[i6], arrayOfInt1[i6]));
      }
    }
    catch (Exception localException)
    {
      Log.d("MKSearchNotifier", "parse DrivingRouteResult error!");
      Log.d("MKSearchNotifier", localException.getMessage());
      return;
    }
    localArrayList4.add(localArrayList6);
    Object[] arrayOfObject3 = new Object[1];
    arrayOfObject3[0] = Integer.valueOf(i5);
    int[] arrayOfInt3 = localBundle1.getIntArray(String.format("aryMcX%d", arrayOfObject3));
    Object[] arrayOfObject4 = new Object[1];
    arrayOfObject4[0] = Integer.valueOf(i5);
    int[] arrayOfInt4 = localBundle1.getIntArray(String.format("aryMcY%d", arrayOfObject4));
    ArrayList localArrayList7;
    if (arrayOfInt3 != null)
      localArrayList7 = new ArrayList();
    for (int i7 = 0; ; i7++)
      if (i7 < arrayOfInt3.length)
      {
        if ((i7 == 0) || (arrayOfInt4[i7] != arrayOfInt4[(i7 - 1)]) || (arrayOfInt3[i7] != arrayOfInt3[(i7 - 1)]))
          localArrayList7.add(new GeoPoint(arrayOfInt4[i7], arrayOfInt3[i7]));
      }
      else
      {
        localArrayList5.add(localArrayList7);
        break label827;
        label632: localMKRoute.b(localArrayList4);
        localMKRoute.a = localArrayList5;
        label646: if (localBundle1.containsKey("aryStep"))
        {
          ArrayList localArrayList3 = new ArrayList();
          Parcelable[] arrayOfParcelable2 = localBundle1.getParcelableArray("aryStep");
          for (int i1 = 0; i1 < arrayOfParcelable2.length; i1++)
          {
            Bundle localBundle2 = (Bundle)arrayOfParcelable2[i1];
            MKStep localMKStep = new MKStep();
            int i2 = localBundle2.getInt("x");
            int i3 = localBundle2.getInt("y");
            GeoPoint localGeoPoint = new GeoPoint(i3, i2);
            localMKStep.a(localGeoPoint);
            localMKStep.a(localBundle2.getInt("dir"));
            localMKStep.a(localBundle2.getString("tip"));
            localArrayList3.add(localMKStep);
          }
          localMKRoute.a(localArrayList3);
        }
        localArrayList2.add(localMKRoute);
        n++;
        break;
        label805: localMKRoutePlan.a(localArrayList2);
        localArrayList1.add(localMKRoutePlan);
        label820: paramMKDrivingRouteResult.a(localArrayList1);
        return;
        label827: i5++;
        break label287;
        label833: i6++;
        break label372;
      }
  }

  private void a(Bundle paramBundle, MKPoiResult paramMKPoiResult, int paramInt)
  {
    switch (paramInt)
    {
    default:
    case 11:
    case 12:
    case 21:
    case 45:
      Parcelable[] arrayOfParcelable;
      do
      {
        return;
        try
        {
          int i6 = paramBundle.getInt("iTotal");
          int i7 = paramBundle.getInt("iCurrNumPois");
          int i8 = paramBundle.getInt("iPageIndex");
          paramMKPoiResult.b(i6);
          paramMKPoiResult.a(i7);
          paramMKPoiResult.d(i8);
          int i9 = i6 / MKSearch.getPoiPageCapacity();
          if (i6 % MKSearch.getPoiPageCapacity() > 0)
            i9++;
          paramMKPoiResult.c(i9);
          String[] arrayOfString6 = paramBundle.getStringArray("aryCaption");
          String[] arrayOfString7 = paramBundle.getStringArray("aryUid");
          String[] arrayOfString8 = paramBundle.getStringArray("aryAddr");
          String[] arrayOfString9 = paramBundle.getStringArray("aryTel");
          String[] arrayOfString10 = paramBundle.getStringArray("aryZip");
          int[] arrayOfInt5 = paramBundle.getIntArray("aryType");
          int[] arrayOfInt6 = paramBundle.getIntArray("aryX");
          int[] arrayOfInt7 = paramBundle.getIntArray("aryY");
          String str2 = paramBundle.getString("city");
          ArrayList localArrayList4 = new ArrayList();
          int i10 = arrayOfString6.length;
          for (int i11 = 0; i11 < i10; i11++)
          {
            MKPoiInfo localMKPoiInfo2 = new MKPoiInfo();
            localMKPoiInfo2.name = arrayOfString6[i11];
            localMKPoiInfo2.address = arrayOfString8[i11];
            localMKPoiInfo2.uid = arrayOfString7[i11];
            localMKPoiInfo2.city = str2;
            localMKPoiInfo2.phoneNum = arrayOfString9[i11];
            localMKPoiInfo2.postCode = arrayOfString10[i11];
            localMKPoiInfo2.ePoiType = arrayOfInt5[i11];
            localMKPoiInfo2.pt = new GeoPoint(arrayOfInt7[i11], arrayOfInt6[i11]);
            localArrayList4.add(localMKPoiInfo2);
          }
          paramMKPoiResult.a(localArrayList4);
          return;
        }
        catch (Exception localException2)
        {
          Log.d("MKSearchNotifier", "parse PoiResult error!");
          Log.d("MKSearchNotifier", localException2.getMessage());
          return;
        }
        arrayOfParcelable = paramBundle.getParcelableArray("aryMultiPoiList");
      }
      while (arrayOfParcelable == null);
      int k = arrayOfParcelable.length;
      ArrayList localArrayList2 = new ArrayList();
      int m = 0;
      if (m < k)
      {
        MKPoiResult localMKPoiResult = new MKPoiResult();
        Bundle localBundle = (Bundle)arrayOfParcelable[m];
        if (localBundle == null)
          localArrayList2.add(localMKPoiResult);
        while (true)
        {
          m++;
          break;
          ArrayList localArrayList3 = new ArrayList();
          int n = localBundle.getInt("iTotal");
          int i1 = localBundle.getInt("iCurrNumPois");
          int i2 = paramBundle.getInt("iPageIndex");
          localMKPoiResult.b(n);
          localMKPoiResult.a(i1);
          localMKPoiResult.d(i2);
          int i3 = n / MKSearch.getPoiPageCapacity();
          if (n % MKSearch.getPoiPageCapacity() > 0)
            i3++;
          localMKPoiResult.c(i3);
          String[] arrayOfString2 = localBundle.getStringArray("aryCaption");
          String[] arrayOfString3 = localBundle.getStringArray("aryAddr");
          String[] arrayOfString4 = localBundle.getStringArray("aryTel");
          String[] arrayOfString5 = localBundle.getStringArray("aryZip");
          int[] arrayOfInt2 = localBundle.getIntArray("aryType");
          int[] arrayOfInt3 = localBundle.getIntArray("aryX");
          int[] arrayOfInt4 = localBundle.getIntArray("aryY");
          String str1 = localBundle.getString("city");
          int i4 = arrayOfString2.length;
          for (int i5 = 0; i5 < i4; i5++)
          {
            MKPoiInfo localMKPoiInfo1 = new MKPoiInfo();
            localMKPoiInfo1.name = arrayOfString2[i5];
            localMKPoiInfo1.address = arrayOfString3[i5];
            localMKPoiInfo1.city = str1;
            localMKPoiInfo1.phoneNum = arrayOfString4[i5];
            localMKPoiInfo1.postCode = arrayOfString5[i5];
            localMKPoiInfo1.ePoiType = arrayOfInt2[i5];
            localMKPoiInfo1.pt = new GeoPoint(arrayOfInt4[i5], arrayOfInt3[i5]);
            localArrayList3.add(localMKPoiInfo1);
          }
          localMKPoiResult.a(localArrayList3);
          localArrayList2.add(localMKPoiResult);
        }
      }
      paramMKPoiResult.b(localArrayList2);
      return;
    case 7:
    }
    try
    {
      String[] arrayOfString1 = paramBundle.getStringArray("aryCity");
      int[] arrayOfInt1 = paramBundle.getIntArray("aryNum");
      ArrayList localArrayList1 = new ArrayList();
      int i = arrayOfString1.length;
      for (int j = 0; j < i; j++)
      {
        MKCityListInfo localMKCityListInfo = new MKCityListInfo();
        localMKCityListInfo.city = arrayOfString1[j];
        localMKCityListInfo.num = arrayOfInt1[j];
        localArrayList1.add(localMKCityListInfo);
      }
      paramMKPoiResult.c(localArrayList1);
      return;
    }
    catch (Exception localException1)
    {
      Log.d("MKSearchNotifier", "parse PoiResult error!");
      Log.d("MKSearchNotifier", localException1.getMessage());
    }
  }

  private void a(Bundle paramBundle, MKSuggestionResult paramMKSuggestionResult, int paramInt)
  {
    for (int i = 0; ; i = 0)
    {
      try
      {
        String[] arrayOfString1 = paramBundle.getStringArray("aryPoiName");
        String[] arrayOfString2 = paramBundle.getStringArray("aryCityName");
        ArrayList localArrayList = new ArrayList();
        if (arrayOfString1 != null)
        {
          j = arrayOfString1.length;
          while (i < j)
          {
            MKSuggestionInfo localMKSuggestionInfo = new MKSuggestionInfo();
            localMKSuggestionInfo.city = arrayOfString2[i];
            localMKSuggestionInfo.key = arrayOfString1[i];
            localArrayList.add(localMKSuggestionInfo);
            i++;
          }
          paramMKSuggestionResult.a(localArrayList);
          paramMKSuggestionResult.getSuggestionNum();
          return;
        }
      }
      catch (Exception localException)
      {
        Log.d("MKSearchNotifier", "parse SuggestionResult error!");
        return;
      }
      int j = 0;
    }
  }

  private void a(Bundle paramBundle, MKTransitRouteResult paramMKTransitRouteResult, int paramInt)
  {
    ArrayList localArrayList1;
    int i1;
    MKTransitRoutePlan localMKTransitRoutePlan;
    Bundle localBundle1;
    ArrayList localArrayList2;
    Parcelable[] arrayOfParcelable2;
    Parcelable[] arrayOfParcelable3;
    label253: int i2;
    int i3;
    label551: int i4;
    while (true)
    {
      MKLine localMKLine;
      Bundle localBundle2;
      ArrayList localArrayList3;
      try
      {
        String str1 = paramBundle.getString("st_name");
        int i = paramBundle.getInt("st_pt_x");
        int j = paramBundle.getInt("st_pt_y");
        MKPlanNode localMKPlanNode1 = new MKPlanNode();
        localMKPlanNode1.name = str1;
        localMKPlanNode1.pt = new GeoPoint(j, i);
        paramMKTransitRouteResult.a(localMKPlanNode1);
        String str2 = paramBundle.getString("en_name");
        int k = paramBundle.getInt("en_pt_x");
        int m = paramBundle.getInt("en_pt_y");
        MKPlanNode localMKPlanNode2 = new MKPlanNode();
        localMKPlanNode2.name = str2;
        localMKPlanNode2.pt = new GeoPoint(m, k);
        paramMKTransitRouteResult.b(localMKPlanNode2);
        localArrayList1 = new ArrayList();
        Parcelable[] arrayOfParcelable1 = paramBundle.getParcelableArray("aryPlan");
        if (arrayOfParcelable1 == null)
        {
          paramMKTransitRouteResult.a(localArrayList1);
          return;
        }
        int n = arrayOfParcelable1.length;
        i1 = 0;
        if (i1 >= n)
          break label1292;
        localMKTransitRoutePlan = new MKTransitRoutePlan();
        localMKTransitRoutePlan.a(localMKPlanNode1.pt);
        localMKTransitRoutePlan.b(localMKPlanNode2.pt);
        localBundle1 = (Bundle)arrayOfParcelable1[i1];
        localMKTransitRoutePlan.a(localBundle1.getInt("distance"));
        localArrayList2 = new ArrayList();
        arrayOfParcelable2 = localBundle1.getParcelableArray("aryLine");
        if (arrayOfParcelable2 != null)
          break label1306;
        arrayOfParcelable3 = new Parcelable[0];
        break label1313;
        if (i2 >= arrayOfParcelable3.length)
          break;
        localMKLine = new MKLine();
        localBundle2 = (Bundle)arrayOfParcelable3[i2];
        localMKLine.b(localBundle2.getInt("distance"));
        localMKLine.c(localBundle2.getInt("type"));
        localMKLine.a(localBundle2.getInt("numStops"));
        localMKLine.b(localBundle2.getString("title"));
        localMKLine.c(localBundle2.getString("uid"));
        localMKLine.a(localBundle2.getString("getOnTip"));
        MKPoiInfo localMKPoiInfo1 = new MKPoiInfo();
        localMKPoiInfo1.name = localBundle2.getString("getOnStopName");
        if (localBundle2.containsKey("getOnStopPtX"))
        {
          int i7 = localBundle2.getInt("getOnStopPtX");
          int i8 = localBundle2.getInt("getOnStopPtY");
          GeoPoint localGeoPoint2 = new GeoPoint(i8, i7);
          localMKPoiInfo1.pt = localGeoPoint2;
        }
        localMKLine.a(localMKPoiInfo1);
        MKPoiInfo localMKPoiInfo2 = new MKPoiInfo();
        localMKPoiInfo2.name = localBundle2.getString("getOffStopName");
        if (localBundle2.containsKey("getOffStopPtX"))
        {
          int i5 = localBundle2.getInt("getOffStopPtX");
          int i6 = localBundle2.getInt("getOffStopPtY");
          GeoPoint localGeoPoint1 = new GeoPoint(i6, i5);
          localMKPoiInfo2.pt = localGeoPoint1;
        }
        localMKLine.b(localMKPoiInfo2);
        int[] arrayOfInt1 = localBundle2.getIntArray("aryX");
        if (arrayOfInt1 == null)
          break label653;
        localArrayList3 = new ArrayList();
        int[] arrayOfInt2 = localBundle2.getIntArray("aryY");
        i3 = 0;
        if (i3 < arrayOfInt1.length)
        {
          if ((i3 != 0) && (arrayOfInt2[i3] == arrayOfInt2[(i3 - 1)]) && (arrayOfInt1[i3] == arrayOfInt1[(i3 - 1)]))
            break label1319;
          localArrayList3.add(new GeoPoint(arrayOfInt2[i3], arrayOfInt1[i3]));
        }
      }
      catch (Exception localException)
      {
        Log.d("MKSearchNotifier", "parse TransitRouteResult error!");
        Log.d("MKSearchNotifier", localException.getMessage());
        return;
      }
      localMKLine.a(localArrayList3);
      label653: int[] arrayOfInt3 = localBundle2.getIntArray("aryMcX");
      if (arrayOfInt3 != null)
      {
        ArrayList localArrayList4 = new ArrayList();
        int[] arrayOfInt4 = localBundle2.getIntArray("aryMcY");
        i4 = 0;
        label690: if (i4 < arrayOfInt3.length)
        {
          if ((i4 != 0) && (arrayOfInt4[i4] == arrayOfInt4[(i4 - 1)]) && (arrayOfInt3[i4] == arrayOfInt3[(i4 - 1)]))
            break label1325;
          localArrayList4.add(new GeoPoint(arrayOfInt4[i4], arrayOfInt3[i4]));
          break label1325;
        }
        localMKLine.a = localArrayList4;
      }
      localArrayList2.add(localMKLine);
      i2++;
    }
    localMKTransitRoutePlan.setLine(localArrayList2);
    ArrayList localArrayList5 = new ArrayList();
    Parcelable[] arrayOfParcelable4 = localBundle1.getParcelableArray("aryRoute");
    Parcelable[] arrayOfParcelable5;
    label822: int i9;
    MKRoute localMKRoute;
    Bundle localBundle3;
    ArrayList localArrayList6;
    ArrayList localArrayList7;
    int i13;
    label980: int[] arrayOfInt5;
    int[] arrayOfInt6;
    if (arrayOfParcelable4 == null)
    {
      arrayOfParcelable5 = new Parcelable[0];
      break label1331;
      if (i9 < arrayOfParcelable5.length)
      {
        localMKRoute = new MKRoute();
        localBundle3 = (Bundle)arrayOfParcelable5[i9];
        localMKRoute.a(localBundle3.getInt("distance"));
        localMKRoute.b(2);
        localMKRoute.a(localBundle3.getString("getOffTip"));
        localArrayList6 = new ArrayList();
        localArrayList7 = new ArrayList();
        if (localBundle3.containsKey("startX"))
        {
          int i14 = localBundle3.getInt("startX");
          int i15 = localBundle3.getInt("startY");
          GeoPoint localGeoPoint4 = new GeoPoint(i15, i14);
          localMKRoute.a(localGeoPoint4);
        }
        if (localBundle3.containsKey("aryX"))
        {
          int[] arrayOfInt7 = localBundle3.getIntArray("aryX");
          int[] arrayOfInt8 = localBundle3.getIntArray("aryY");
          i13 = 0;
          if (i13 < arrayOfInt7.length)
          {
            if ((i13 != 0) && (arrayOfInt8[i13] == arrayOfInt8[(i13 - 1)]) && (arrayOfInt7[i13] == arrayOfInt7[(i13 - 1)]))
              break label1337;
            localArrayList6.add(new GeoPoint(arrayOfInt8[i13], arrayOfInt7[i13]));
            break label1337;
          }
        }
        if (localBundle3.containsKey("aryMcX"))
        {
          arrayOfInt5 = localBundle3.getIntArray("aryMcX");
          arrayOfInt6 = localBundle3.getIntArray("aryMcY");
        }
      }
    }
    for (int i12 = 0; ; i12++)
      if (i12 < arrayOfInt5.length)
      {
        if ((i12 == 0) || (arrayOfInt6[i12] != arrayOfInt6[(i12 - 1)]) || (arrayOfInt5[i12] != arrayOfInt5[(i12 - 1)]))
          localArrayList7.add(new GeoPoint(arrayOfInt6[i12], arrayOfInt5[i12]));
      }
      else
      {
        if (localBundle3.containsKey("endX"))
        {
          int i10 = localBundle3.getInt("endX");
          int i11 = localBundle3.getInt("endY");
          GeoPoint localGeoPoint3 = new GeoPoint(i11, i10);
          localMKRoute.b(localGeoPoint3);
        }
        ArrayList localArrayList8 = new ArrayList();
        localArrayList8.add(localArrayList6);
        localMKRoute.b(localArrayList8);
        ArrayList localArrayList9 = new ArrayList();
        localArrayList9.add(localArrayList7);
        localMKRoute.a = localArrayList9;
        localArrayList5.add(localMKRoute);
        i9++;
        break label822;
        localMKTransitRoutePlan.a(localArrayList5);
        localArrayList1.add(localMKTransitRoutePlan);
        i1++;
        break;
        label1292: paramMKTransitRouteResult.a(localArrayList1);
        return;
        arrayOfParcelable5 = arrayOfParcelable4;
        break label1331;
        label1306: arrayOfParcelable3 = arrayOfParcelable2;
        label1313: i2 = 0;
        break label253;
        label1319: i3++;
        break label551;
        label1325: i4++;
        break label690;
        label1331: i9 = 0;
        break label822;
        label1337: i13++;
        break label980;
      }
  }

  private void a(Bundle paramBundle, MKWalkingRouteResult paramMKWalkingRouteResult, int paramInt)
  {
    ArrayList localArrayList1;
    MKRoutePlan localMKRoutePlan;
    ArrayList localArrayList2;
    int n;
    MKRoute localMKRoute;
    Bundle localBundle1;
    ArrayList localArrayList4;
    ArrayList localArrayList5;
    int i6;
    label287: ArrayList localArrayList6;
    int i7;
    try
    {
      String str1 = paramBundle.getString("st_name");
      int i = paramBundle.getInt("st_pt_x");
      int j = paramBundle.getInt("st_pt_y");
      MKPlanNode localMKPlanNode1 = new MKPlanNode();
      localMKPlanNode1.name = str1;
      localMKPlanNode1.pt = new GeoPoint(j, i);
      paramMKWalkingRouteResult.a(localMKPlanNode1);
      String str2 = paramBundle.getString("en_name");
      int k = paramBundle.getInt("en_pt_x");
      int m = paramBundle.getInt("en_pt_y");
      MKPlanNode localMKPlanNode2 = new MKPlanNode();
      localMKPlanNode2.name = str2;
      localMKPlanNode2.pt = new GeoPoint(m, k);
      paramMKWalkingRouteResult.b(localMKPlanNode2);
      localArrayList1 = new ArrayList();
      if (paramBundle.getInt("planNum") <= 0)
        break label825;
      localMKRoutePlan = new MKRoutePlan();
      localMKRoutePlan.a(paramBundle.getInt("distance"));
      localArrayList2 = new ArrayList();
      Parcelable[] arrayOfParcelable1 = paramBundle.getParcelableArray("aryRoute");
      n = 0;
      if (n >= arrayOfParcelable1.length)
        break label810;
      localMKRoute = new MKRoute();
      localBundle1 = (Bundle)arrayOfParcelable1[n];
      localMKRoute.a(localBundle1.getInt("distance"));
      localMKRoute.b(2);
      localMKRoute.a(localMKPlanNode1.pt);
      localMKRoute.b(localMKPlanNode2.pt);
      if (!localBundle1.containsKey("link"))
        break label647;
      int i5 = localBundle1.getInt("link");
      localArrayList4 = new ArrayList();
      localArrayList5 = new ArrayList();
      i6 = 0;
      if (i6 >= i5)
        break label633;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = Integer.valueOf(i6);
      int[] arrayOfInt1 = localBundle1.getIntArray(String.format("aryX%d", arrayOfObject1));
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Integer.valueOf(i6);
      int[] arrayOfInt2 = localBundle1.getIntArray(String.format("aryY%d", arrayOfObject2));
      if (arrayOfInt1 == null)
        break label832;
      localArrayList6 = new ArrayList();
      i7 = 0;
      label372: if (i7 < arrayOfInt1.length)
      {
        if ((i7 != 0) && (arrayOfInt2[i7] == arrayOfInt2[(i7 - 1)]) && (arrayOfInt1[i7] == arrayOfInt1[(i7 - 1)]))
          break label838;
        localArrayList6.add(new GeoPoint(arrayOfInt2[i7], arrayOfInt1[i7]));
      }
    }
    catch (Exception localException)
    {
      Log.d("MKSearchNotifier", "parse WalkingRouteResult error!");
      Log.d("MKSearchNotifier", localException.getMessage());
      return;
    }
    localArrayList4.add(localArrayList6);
    Object[] arrayOfObject3 = new Object[1];
    arrayOfObject3[0] = Integer.valueOf(i6);
    int[] arrayOfInt3 = localBundle1.getIntArray(String.format("aryMcX%d", arrayOfObject3));
    Object[] arrayOfObject4 = new Object[1];
    arrayOfObject4[0] = Integer.valueOf(i6);
    int[] arrayOfInt4 = localBundle1.getIntArray(String.format("aryMcY%d", arrayOfObject4));
    ArrayList localArrayList7;
    if (arrayOfInt3 != null)
      localArrayList7 = new ArrayList();
    for (int i8 = 0; ; i8++)
      if (i8 < arrayOfInt3.length)
      {
        if ((i8 == 0) || (arrayOfInt4[i8] != arrayOfInt4[(i8 - 1)]) || (arrayOfInt3[i8] != arrayOfInt3[(i8 - 1)]))
          localArrayList7.add(new GeoPoint(arrayOfInt4[i8], arrayOfInt3[i8]));
      }
      else
      {
        localArrayList5.add(localArrayList7);
        break label832;
        label633: localMKRoute.b(localArrayList4);
        localMKRoute.a = localArrayList5;
        label647: if (localBundle1.containsKey("aryStep"))
        {
          ArrayList localArrayList3 = new ArrayList();
          Parcelable[] arrayOfParcelable2 = localBundle1.getParcelableArray("aryStep");
          int i1 = arrayOfParcelable2.length;
          for (int i2 = 0; i2 < i1; i2++)
          {
            Bundle localBundle2 = (Bundle)arrayOfParcelable2[i2];
            MKStep localMKStep = new MKStep();
            int i3 = localBundle2.getInt("x");
            int i4 = localBundle2.getInt("y");
            GeoPoint localGeoPoint = new GeoPoint(i4, i3);
            localMKStep.a(localGeoPoint);
            localMKStep.a(localBundle2.getInt("dir"));
            localMKStep.a(localBundle2.getString("tip"));
            localArrayList3.add(localMKStep);
          }
          localMKRoute.a(localArrayList3);
        }
        localArrayList2.add(localMKRoute);
        n++;
        break;
        label810: localMKRoutePlan.a(localArrayList2);
        localArrayList1.add(localMKRoutePlan);
        label825: paramMKWalkingRouteResult.a(localArrayList1);
        return;
        label832: i6++;
        break label287;
        label838: i7++;
        break label372;
      }
  }

  private void a(Bundle paramBundle, ArrayList<MKPoiInfo> paramArrayList)
  {
    String[] arrayOfString1 = paramBundle.getStringArray("aryCaption");
    String[] arrayOfString2 = paramBundle.getStringArray("aryAddr");
    int[] arrayOfInt1 = paramBundle.getIntArray("aryX");
    int[] arrayOfInt2 = paramBundle.getIntArray("aryY");
    int i = arrayOfString1.length;
    for (int j = 0; j < i; j++)
    {
      MKPoiInfo localMKPoiInfo = new MKPoiInfo();
      localMKPoiInfo.name = arrayOfString1[j];
      localMKPoiInfo.address = arrayOfString2[j];
      localMKPoiInfo.pt = new GeoPoint(arrayOfInt2[j], arrayOfInt1[j]);
      paramArrayList.add(localMKPoiInfo);
    }
  }

  private boolean a(Bundle paramBundle, MKBusLineResult paramMKBusLineResult)
  {
    MKRoute localMKRoute;
    ArrayList localArrayList1;
    ArrayList localArrayList2;
    int j;
    ArrayList localArrayList3;
    int m;
    try
    {
      String str1 = paramBundle.getString("company");
      String str2 = paramBundle.getString("busName");
      String str3 = paramBundle.getString("startTime");
      String str4 = paramBundle.getString("endTime");
      paramMKBusLineResult.a(str1, str2, paramBundle.getInt("monTicket"));
      paramMKBusLineResult.a(str3);
      paramMKBusLineResult.b(str4);
      localMKRoute = paramMKBusLineResult.getBusRoute();
      localMKRoute.b(3);
      localArrayList1 = new ArrayList();
      localArrayList2 = new ArrayList();
      if (!paramBundle.containsKey("link"))
        break label673;
      int i = paramBundle.getInt("link");
      j = 0;
      if (j >= i)
        break label462;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = Integer.valueOf(j);
      int[] arrayOfInt1 = paramBundle.getIntArray(String.format("aryX%d", arrayOfObject1));
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Integer.valueOf(j);
      int[] arrayOfInt2 = paramBundle.getIntArray(String.format("aryY%d", arrayOfObject2));
      if (arrayOfInt1 == null)
        break label655;
      localArrayList3 = new ArrayList();
      int k = arrayOfInt1.length;
      m = 0;
      label201: if (m >= k)
        break label294;
      if ((m != 0) && (arrayOfInt2[m] == arrayOfInt2[(m - 1)]) && (arrayOfInt1[m] == arrayOfInt1[(m - 1)]))
        break label661;
      localArrayList3.add(new GeoPoint(arrayOfInt2[m], arrayOfInt1[m]));
    }
    catch (Exception localException)
    {
      Log.d("MKSearchNotifier", "parse BusDetail error!");
      Log.d("MKSearchNotifier", localException.getMessage());
    }
    label292: return true;
    label294: localArrayList1.add(localArrayList3);
    Object[] arrayOfObject3 = new Object[1];
    arrayOfObject3[0] = Integer.valueOf(j);
    int[] arrayOfInt3 = paramBundle.getIntArray(String.format("aryMcX%d", arrayOfObject3));
    Object[] arrayOfObject4 = new Object[1];
    arrayOfObject4[0] = Integer.valueOf(j);
    int[] arrayOfInt4 = paramBundle.getIntArray(String.format("aryMcY%d", arrayOfObject4));
    int i1;
    label380: int i2;
    label462: ArrayList localArrayList5;
    Parcelable[] arrayOfParcelable;
    if (arrayOfInt3 != null)
    {
      ArrayList localArrayList4 = new ArrayList();
      int n = arrayOfInt3.length;
      i1 = 0;
      if (i1 < n)
      {
        if ((i1 != 0) && (arrayOfInt4[i1] == arrayOfInt4[(i1 - 1)]) && (arrayOfInt3[i1] == arrayOfInt3[(i1 - 1)]))
          break label667;
        localArrayList4.add(new GeoPoint(arrayOfInt4[i1], arrayOfInt3[i1]));
        break label667;
      }
      localArrayList2.add(localArrayList4);
      break label655;
      localMKRoute.b(localArrayList1);
      localMKRoute.a = localArrayList2;
      i2 = paramBundle.getInt("stopSize");
      if (paramBundle.containsKey("aryStep"))
      {
        localArrayList5 = new ArrayList();
        arrayOfParcelable = paramBundle.getParcelableArray("aryStep");
        if (arrayOfParcelable.length == i2)
          break label675;
        return false;
      }
    }
    while (true)
    {
      int i3;
      if (i3 < i2)
      {
        Bundle localBundle = (Bundle)arrayOfParcelable[i3];
        MKStep localMKStep = new MKStep();
        int i4 = localBundle.getInt("x");
        localMKStep.a(new GeoPoint(localBundle.getInt("y"), i4));
        localMKStep.a(localBundle.getString("name"));
        localArrayList5.add(localMKStep);
        i3++;
      }
      else
      {
        localMKRoute.a(localArrayList5);
        localMKRoute.a(((MKStep)localArrayList5.get(0)).getPoint());
        localMKRoute.b(((MKStep)localArrayList5.get(i2 - 1)).getPoint());
        break label292;
        return false;
        label655: j++;
        break;
        label661: m++;
        break label201;
        label667: i1++;
        break label380;
        label673: return false;
        label675: i3 = 0;
      }
    }
  }

  private void b(Bundle paramBundle, ArrayList<MKCityListInfo> paramArrayList)
  {
    String[] arrayOfString = paramBundle.getStringArray("aryCity");
    int[] arrayOfInt = paramBundle.getIntArray("aryNum");
    int i = arrayOfString.length;
    for (int j = 0; j < i; j++)
    {
      MKCityListInfo localMKCityListInfo = new MKCityListInfo();
      localMKCityListInfo.city = arrayOfString[j];
      localMKCityListInfo.num = arrayOfInt[j];
      paramArrayList.add(localMKCityListInfo);
    }
  }

  public void a(MKEvent paramMKEvent)
  {
    int i = 1;
    MKPoiResult localMKPoiResult;
    int m;
    switch (paramMKEvent.a)
    {
    case 5:
    case 7:
    case 8:
    case 9:
    case 12:
    case 13:
    case 14:
    default:
      return;
    case 1:
      if (paramMKEvent.b != 0)
      {
        this.a.onGetPoiResult(null, 0, paramMKEvent.b);
        return;
      }
      Bundle localBundle10 = Mj.getNewBundle(11010204, paramMKEvent.c, 0);
      if (localBundle10 != null)
      {
        localMKPoiResult = new MKPoiResult();
        a(localBundle10, localMKPoiResult, paramMKEvent.c);
        if (paramMKEvent.c == 45)
        {
          ArrayList localArrayList = localMKPoiResult.getMultiPoiResult();
          if (localArrayList == null)
            break label1302;
          m = 0;
          if (m >= localArrayList.size())
            break label1302;
          if (((MKPoiResult)localArrayList.get(m)).getAllPoi() == null)
            break;
        }
      }
      break;
    case 6:
    case 10:
    case 2:
    case 3:
    case 4:
    case 11:
    case 15:
    case 16:
    case 17:
    }
    while (true)
    {
      if (i == 0)
      {
        this.a.onGetPoiResult(null, paramMKEvent.c, 100);
        return;
        m++;
        break;
      }
      this.a.onGetPoiResult(localMKPoiResult, paramMKEvent.c, 0);
      return;
      this.a.onGetPoiResult(localMKPoiResult, paramMKEvent.c, 0);
      return;
      this.a.onGetPoiResult(null, 0, 100);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetAddrResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle9 = Mj.getNewBundle(11010204, paramMKEvent.c, 0);
      if (localBundle9 != null)
      {
        MKAddrInfo localMKAddrInfo2 = new MKAddrInfo();
        localMKAddrInfo2.type = i;
        a(localBundle9, localMKAddrInfo2, paramMKEvent.c);
        if ((localMKAddrInfo2.strAddr == null) || (localMKAddrInfo2.strAddr.length() == 0))
        {
          this.a.onGetAddrResult(null, 100);
          return;
        }
        this.a.onGetAddrResult(localMKAddrInfo2, 0);
        return;
      }
      this.a.onGetAddrResult(null, 100);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetAddrResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle8 = Mj.getNewBundle(11010204, paramMKEvent.c, 0);
      if (localBundle8 != null)
      {
        MKAddrInfo localMKAddrInfo1 = new MKAddrInfo();
        localMKAddrInfo1.type = 0;
        a(localBundle8, localMKAddrInfo1);
        this.a.onGetAddrResult(localMKAddrInfo1, 0);
        return;
      }
      this.a.onGetAddrResult(null, 100);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetTransitRouteResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle7 = Mj.getNewBundle(11020204, paramMKEvent.c, 0);
      if (localBundle7 != null)
      {
        MKTransitRouteResult localMKTransitRouteResult2 = new MKTransitRouteResult();
        a(localBundle7, localMKTransitRouteResult2, paramMKEvent.c);
        this.a.onGetTransitRouteResult(localMKTransitRouteResult2, 0);
        return;
      }
      this.a.onGetTransitRouteResult(null, 100);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetDrivingRouteResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle6 = Mj.getNewBundle(11020204, paramMKEvent.c, 0);
      if (localBundle6 != null)
      {
        MKDrivingRouteResult localMKDrivingRouteResult2 = new MKDrivingRouteResult();
        a(localBundle6, localMKDrivingRouteResult2, paramMKEvent.c);
        this.a.onGetDrivingRouteResult(localMKDrivingRouteResult2, 0);
        return;
      }
      this.a.onGetDrivingRouteResult(null, 100);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetWalkingRouteResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle5 = Mj.getNewBundle(11020204, paramMKEvent.c, 0);
      if (localBundle5 != null)
      {
        MKWalkingRouteResult localMKWalkingRouteResult2 = new MKWalkingRouteResult();
        a(localBundle5, localMKWalkingRouteResult2, paramMKEvent.c);
        this.a.onGetWalkingRouteResult(localMKWalkingRouteResult2, 0);
        return;
      }
      this.a.onGetWalkingRouteResult(null, 100);
      return;
      Bundle localBundle4 = Mj.getNewBundle(11020204, paramMKEvent.c, 0);
      MKRouteAddrResult localMKRouteAddrResult = new MKRouteAddrResult();
      switch (a(localBundle4, localMKRouteAddrResult))
      {
      default:
        return;
      case 0:
        MKDrivingRouteResult localMKDrivingRouteResult1 = new MKDrivingRouteResult();
        localMKDrivingRouteResult1.a(localMKRouteAddrResult);
        this.a.onGetDrivingRouteResult(localMKDrivingRouteResult1, 4);
        return;
      case 1:
        if ((localMKRouteAddrResult.mStartPoiList == null) || (localMKRouteAddrResult.mEndPoiList == null))
        {
          this.a.onGetTransitRouteResult(null, 100);
          return;
        }
        MKTransitRouteResult localMKTransitRouteResult1 = new MKTransitRouteResult();
        localMKTransitRouteResult1.a(localMKRouteAddrResult);
        this.a.onGetTransitRouteResult(localMKTransitRouteResult1, 4);
        return;
      case 2:
      }
      MKWalkingRouteResult localMKWalkingRouteResult1 = new MKWalkingRouteResult();
      localMKWalkingRouteResult1.a(localMKRouteAddrResult);
      this.a.onGetWalkingRouteResult(localMKWalkingRouteResult1, 4);
      return;
      if (paramMKEvent.b != 0)
      {
        this.a.onGetBusDetailResult(null, paramMKEvent.b);
        return;
      }
      Bundle localBundle3 = Mj.getNewBundle(11020204, paramMKEvent.c, 0);
      MKBusLineResult localMKBusLineResult;
      int k;
      if (localBundle3 != null)
      {
        localMKBusLineResult = new MKBusLineResult();
        boolean bool = a(localBundle3, localMKBusLineResult);
        k = 0;
        if (!bool)
          break label1295;
      }
      while (true)
      {
        this.a.onGetBusDetailResult(localMKBusLineResult, k);
        return;
        this.a.onGetBusDetailResult(null, 100);
        return;
        if (paramMKEvent.b != 0)
        {
          this.a.onGetSuggestionResult(null, paramMKEvent.b);
          return;
        }
        Bundle localBundle2 = Mj.getNewBundle(11010107, paramMKEvent.c, 0);
        MKSuggestionResult localMKSuggestionResult;
        if (localBundle2 != null)
        {
          localMKSuggestionResult = new MKSuggestionResult();
          a(localBundle2, localMKSuggestionResult, paramMKEvent.c);
          if (paramMKEvent.c == 506)
            if (localMKSuggestionResult.getSuggestionNum() <= 0)
              break label1290;
        }
        while (true)
        {
          if (i == 0)
          {
            this.a.onGetSuggestionResult(null, 100);
            return;
          }
          this.a.onGetSuggestionResult(localMKSuggestionResult, 0);
          return;
          this.a.onGetSuggestionResult(localMKSuggestionResult, 0);
          return;
          this.a.onGetSuggestionResult(null, 100);
          return;
          if (paramMKEvent.b != 0)
          {
            this.a.onGetRGCShareUrlResult(null, paramMKEvent.b);
            return;
          }
          Bundle localBundle1 = Mj.getNewBundle(11010110, paramMKEvent.c, 0);
          String str;
          if (localBundle1 != null)
          {
            str = localBundle1.getString("shortUrl");
            if (paramMKEvent.c == 500)
              if ((str == null) || (str == ""))
                break label1284;
          }
          label1284: for (int j = i; ; j = 0)
          {
            if (j == 0)
            {
              this.a.onGetRGCShareUrlResult(null, 100);
              return;
            }
            this.a.onGetRGCShareUrlResult(str, 0);
            return;
            this.a.onGetRGCShareUrlResult(str, 0);
            return;
            this.a.onGetRGCShareUrlResult(null, 100);
            return;
          }
          label1290: i = 0;
        }
        label1295: k = 100;
      }
      label1302: i = 0;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.baidu.mapapi.j
 * JD-Core Version:    0.6.2
 */